<template>
	<view class="index_page">
		<view class="banner">
			<view class="banner_content">
				<view class="top">
					<view class="left">
						<image mode="widthFix" src="../../static/index/photo.png"></image>
						<text>岁月</text>
					</view>
					<view class="right">
						<image mode="widthFix" src="../../static/index/Shopping.png"></image>
						<text>购物车</text>
						<view class="circle">5</view>
					</view>
					<view class="goLogin" v-if="showLoginBtn" @click="goLogin">登录</view>
				</view>
				<view class="total">
					<view class="total_title">总积分</view>
					<view class="toptal_num">50000</view>
				</view>
				<view class="tow_score">
					<view class="box">
						<view class="title">50000</view>
						<view class="num">可用积分</view>
					</view>
					<view class="box">
						<view class="title">50000</view>
						<view class="num">冻结积分</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import getJingpin from "../../request/fetch.js"
	export default {
		data() {
			return {
				//是否显示登录按钮
				showLoginBtn: true
			}
		},
		created() {
			const token = uni.getStorageSync('x-auth-token')
			this.showLoginBtn = !token;
			
			// getJingpin().then(res=>{
			// 	console.log(res);
			// })
			
		},
		
		onLoad() {
		
		},
		methods: {
			goLogin(){
				uni.navigateTo({
					url:'../login/login'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.banner {
		width: 100%;
		height: 478rpx;
		background: url(../../static/index/bg.png) no-repeat center bottom;
		background-size: contain;
		overflow: hidden;
		
		.banner_content {
			width: 680rpx;
			margin: auto;
			color: #fff;
			margin-top: 30rpx;
			height: 448rpx;
			border-radius: 20px 20px 0rpx 0rpx;
			padding: 40rpx 30rpx 0 30rpx;
			box-sizing: border-box;
			
			.top {
				height: 48rpx;
				margin-bottom: 55rpx;
				display: flex;
				justify-content: space-between;
				
				.left {
					display: flex;
					align-items: center;
					image {
						width: 48rpx;
						margin-right: 9rpx;
					}
				}
				.right {
					display: flex;
					align-items: center;
					image {
						width: 27rpx;
						margin-right: 10rpx;
					}
					.circle{
						width: 22rpx;
						height: 22rpx;
						background: #FD604D;
						border-radius: 11px;
						font-size: 18rpx;
						margin-left: 7rpx;
						text-align: center;
						line-height: 22rpx;
					}
				}
				.goLogin {
					width: 200rpx;
					height: 60rpx;
					background: #fff;
					text-align: center;
					line-height: 60rpx;
					border-radius: 40rpx;
					color: #333999;
					font-size: 24rpx;
				}
				
			}
			.total {
				text-align: center;
				.total_title {
					height: 26rpx;
					line-height: 26rpx;
					font-size: 26rpx;
					margin-bottom: 23rpx;
				}
				.total_num {
					height: 62rpx;
					line-height: 62rpx;
					font-size: 62rpx;
				}
			}
			.tow_score {
				display: flex;
				justify-content: space-between;
				margin-top: 63rpx;
				
				.box {
					width: 50%;
					text-align: center;
					.num {
						height: 24rpx;
						line-height: 24rpx;
						font-size: 24rpx;
						margin-bottom: 15px;
					}
					.title {
						height: 26rpx;
						line-height: 26rpx;
						font-size: 26rpx;
					}
				}
			}
		}
	}
</style>
